package com.javabase.study.OOPFistPart;

/**
 * TODO
 * 内容：测试抽象类
 * 作者:jxx
 * 创建时间：2021/6/17
 */
abstract class AnimalAbs{//抽象类
    abstract public void shout();//抽象方法
}
class Dog1 extends AnimalAbs{
    //子类必须实现父类的抽象方法，否则编译错误
    public void shout(){
        System.out.println("汪汪汪");
    }
    public void seeDoor(){
        System.out.println("看门中");
    }

}
public class TestAbstract {
    public static void main(String[] args){

        Dog1 dog1 = new Dog1();
        dog1.shout();
        dog1.seeDoor();
    }
}
